<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">






  
  
  <link rel="stylesheet" media="all" href="/lib/Han/dist/han.min.css?v=3.3">




<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.png?v=5.1.4">


  <link rel="mask-icon" href="/images/favicon.png?v=5.1.4" color="#222">





  <meta name="keywords" content="论文," />





  <link rel="alternate" href="/atom.xml" title="平步青云win" type="application/atom+xml" />






<meta name="description" content="摘要存储可以提供灵活、可伸缩的数据存储服务。然而，一旦数据上传至云服务器，本地计算机没有拷贝，用户失去了对数据的物理控制。因此，研究一种方法来确保用户数据的完整性是有必要的。避免检索大量存储数或避免由用户检验数据，一种基于格加密的公开审计存储协议证明被提出。用户计算数据块的的标签，并且上传它们至云服务器。云服务器提供联合的块。第三方审计者通过联合的数据和标签来验证所有数据块的完整性。基于小整数解假">
<meta name="keywords" content="论文">
<meta property="og:type" content="article">
<meta property="og:title" content="Public Proof of Cloud Storage from Lattice Assumption∗">
<meta property="og:url" content="https://zxpgo.github.io/2018/10/03/Public Proof of Cloud Storage from Lattice Assumption/index.html">
<meta property="og:site_name" content="平步青云win">
<meta property="og:description" content="摘要存储可以提供灵活、可伸缩的数据存储服务。然而，一旦数据上传至云服务器，本地计算机没有拷贝，用户失去了对数据的物理控制。因此，研究一种方法来确保用户数据的完整性是有必要的。避免检索大量存储数或避免由用户检验数据，一种基于格加密的公开审计存储协议证明被提出。用户计算数据块的的标签，并且上传它们至云服务器。云服务器提供联合的块。第三方审计者通过联合的数据和标签来验证所有数据块的完整性。基于小整数解假">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://i.imgur.com/fUyZKYM.png">
<meta property="og:image" content="https://i.imgur.com/QBgIohN.png">
<meta property="og:updated_time" content="2018-10-27T02:11:41.654Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Public Proof of Cloud Storage from Lattice Assumption∗">
<meta name="twitter:description" content="摘要存储可以提供灵活、可伸缩的数据存储服务。然而，一旦数据上传至云服务器，本地计算机没有拷贝，用户失去了对数据的物理控制。因此，研究一种方法来确保用户数据的完整性是有必要的。避免检索大量存储数或避免由用户检验数据，一种基于格加密的公开审计存储协议证明被提出。用户计算数据块的的标签，并且上传它们至云服务器。云服务器提供联合的块。第三方审计者通过联合的数据和标签来验证所有数据块的完整性。基于小整数解假">
<meta name="twitter:image" content="https://i.imgur.com/fUyZKYM.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"right","display":"post","offset":10,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: 'PAO8LM7QB1',
      apiKey: '',
      indexName: 'Blog',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://zxpgo.github.io/2018/10/03/Public Proof of Cloud Storage from Lattice Assumption/"/>





  <title>Public Proof of Cloud Storage from Lattice Assumption∗ | 平步青云win</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?7a4517a3ce6d7c50203655d056f01ac3";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-right page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">平步青云win</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description"></h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-随笔">
          <a href="/sui" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            随笔
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
			
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://zxpgo.github.io/2018/10/03/Public Proof of Cloud Storage from Lattice Assumption/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="zxp">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="平步青云win">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">Public Proof of Cloud Storage from Lattice Assumption∗</h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-10-03T14:18:50+08:00">
                2018-10-03
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/论文/" itemprop="url" rel="index">
                    <span itemprop="name">论文</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/2018/10/03/Public Proof of Cloud Storage from Lattice Assumption/" class="leancloud_visitors" data-flag-title="Public Proof of Cloud Storage from Lattice Assumption∗">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body han-init-context" itemprop="articleBody">

      
      

      
        <h2 id="摘要"><a href="#摘要" class="headerlink" title="摘要"></a>摘要</h2><p>存储可以提供灵活、可伸缩的数据存储服务。然而，一旦数据上传至云服务器，本地计算机没有拷贝，用户失去了对数据的物理控制。因此，研究一种方法来确保用户数据的完整性是有必要的。避免检索大量存储数或避免由用户检验数据，一种基于格加密的公开审计存储协议证明被提出。用户计算数据块的的标签，并且上传它们至云服务器。云服务器提供联合的块。第三方审计者通过联合的数据和标签来验证所有数据块的完整性。基于小整数解假设，<br>给出的方案可以抵抗来自云服务器的丢失攻击和篡改攻击。基于错误假设的学习，给出的方案可以抵抗来自第三方审计者的好奇攻击。该方案是高效的，仅仅需要几个矩阵向量乘法和离散高斯函数的抽样。</p>
<p><strong>关键词</strong>：  云存储 存储证明 格加密 公开审计<a id="more"></a></p>
<h2 id="一、前言"><a href="#一、前言" class="headerlink" title="一、前言"></a>一、前言</h2><p>云存储作为云计算的一个基础服务，例如，微软的Azure存储服务和亚马逊的简单存储服务，已经提供给用户使用。在云上，用户可以在任何地方任何时间访问数据，享受更可靠的服务。云存储服务被设想为下一代存储服务。同时，云存储也带来一些新的和具有挑战性的安全问题【1-2】。一旦用户将数据上传至云，数据被云服务提供商控制（CSP）。引用的案例【3】说明了云存储不仅受到外部或外部数据安全威胁，尽管CSP声明了数据的完整性。因此，安全问题成为了影响用户选择云存储服务的主要因素。</p>
<p>在互联网上，数据的丢失或篡改可以有用户执行数据完整性验证来检验。然而，云存储服务有一些特殊的特征首先，存储在云上的数据都是巨大的，由于昂贵的I/O和传输成倍，通过恢复数据来验证数据的完整性是不可行的。其次，云存储服务使用分布式存储系统，于是数据存储在一系列云服务器上。互联网上的数据完整验证方案不再适应于云存储系统。一些针对云的安全方案被研究【4-5】。在云存储系统，存储证明可以可以分为两类：私有审计【6，7】和公开审计【8-10】。对于私有审计，仅仅用户自己检验他们外包的数据的完整性，其引起了巨大的开销。为了避免CSP或数据拥有者任意一方执行审计，公开审计，将审计程序移交给第三方审计者（TPA）,这是一个自然的选择。正如【9，10】所示，同态是公开审计一个有用的工具。</p>
<p>最近，基于格加密已经成为了热点研究课题，因为它在量子攻击（quantum attacks）下是安全的【11】。因为新的格难题的陷门函数(Trapdoor function)被成功的提出在【12】，对于云，许多基于格的方案被提出，其展示了格加密的数学优雅，实现的简单性，可证明的安全性降低，效率显著提高。一个简单有效的签名方叫做GPV签名【12】被提出与一个行的陷门函数。随后，Boneh和Freeman【13】提出了第一个在$F_2$上线性同态签名算法，其的不可伪造性是基于小整数解（SIS）问题。Boneh和Freeman【14】提出了第一个的同态签名方案，该方案能做在Eurocrypt2011上签署数据的多元多项式。其不可伪造性基于理想格上的SIS问题。在【15】中，基于加法的同态的韩系函数，给出了一个效率上的改进。</p>
<p>文献【17】尝试使用基于格的加密方案来验证云存储系统中数据完整性。一个来自格假设的线性同态签名被提出，第一个基于格的存储协议证明基于它被构造。然而，怎么利用$(W_i)_{i=1}^k$和$\sum_i c_i f_i$来计算$\sum_i c_i H(W_i) f_i$没有被解释。$\sum_i c_i f_i$可能泄漏一些关于文件$F=(f_1,\dots,f_k)$的信息给验证者TPA，因此该方案不支持公开审计。</p>
<p>本文旨在提出一种基于格加密的云存储数据的公开审计。本文余下阻止如下：在第二节，本文研究需要的技术知识被给出。系统模型、攻击模型和公开审计的设计目标在第三节给出。第四节，一种云存储数据的公开验证协议被提出，没有文献【17】的缺陷。在第五节，分析了提出方案的安全性和性能。在第六节，给出了结论和未来工作。</p>
<h2 id="二、预备知识"><a href="#二、预备知识" class="headerlink" title="二、预备知识"></a>二、预备知识</h2><h3 id="1-格"><a href="#1-格" class="headerlink" title="1.格"></a>1.格</h3><p>对于任何整数$q \geq 2$，设$Z_p$表示模数位$q$的整数环。设$Z_q^{n \times m}$表示元素在$Z_p$中大小为$n \times m$的矩阵集合。</p>
<p>整数格的点的坐标为$Z^m$。对于任何整数$q \geq 2$，$u \in Z_q^n$和矩阵$A \in Z_q^{n \times m}$，定义整数格如下：</p>
<p><img src="https://i.imgur.com/fUyZKYM.png" alt=""></p>
<p>对任何$t \in \Lambda_q^u(A)$，$\Lambda_q^u(A) = \Lambda_q^{\bot}(A) + t$</p>
<h3 id="2-离散高斯抽样"><a href="#2-离散高斯抽样" class="headerlink" title="2. 离散高斯抽样"></a>2. 离散高斯抽样</h3><p>格应用在密码学上是有效的，因为它的自然陷门特征。事实上，所有基于格的加密方案给出了怎么通过一种理论上可靠的方法去使用一个陷门函数。格的一个短基是一个陷门。</p>
<p><strong>定理一</strong> 生成一个短基【12】：设$q$是一个整数，$m \geq 5nlogq$。一个概率多项式时间算法$TrapGen(q,n)$，其输出$(A \in Z_q^{n \times m}, T \in Z^{m \times m})$:</p>
<p>(1) $A$在$Z_q^{n \times m}$统计地上服从一个一致矩阵。</p>
<p>(2) $T$是$\Lambda_q^{\bot}(A)$的一个基。</p>
<p>(3) $T(||T||)$中所有行的欧几里德范式以$O(nlogn)$为界。</p>
<p><strong>定理二</strong> 从离散高斯分布抽样【12】：一个概率多项式时间算法$asmpePre(A,T,\sigma)$，给定一个矩阵$A \in Z_q^{n \times m}$，$\Lambda_q^{\bot}(A)$的一个基$T$，一个系数$\sigma \geq ||\check{T}|| \cdot w(\sqrt{logn})$，一个向量$u \in Z^n$，输出是来自一个分布的抽样，该分布统计地趋近于$D_{\Lambda_q^u(A)},\sigma$。$D_{\Lambda_q^u(A)},\sigma$是$\Lambda_q^u(A)$上系数为$\sigma$的离散高斯分布。</p>
<h3 id="3-困难假设"><a href="#3-困难假设" class="headerlink" title="3. 困难假设"></a>3. 困难假设</h3><p>经典的基于格的困难问题主要包括：最短向量问题、最近向量问题和最小基问题。进一步，为了提出加密方案，小整数解问题$SIS_{q,m,\beta}$被减少，如下：</p>
<p>给定一个整数$q$，一个矩阵$A \in Z_q^{n \times m}$和一个实数$\beta$，找一个非零向量$e \in Z^m $，满足： $A \cdot e = 0 mod q$和$||e|| \leq \beta$。</p>
<p>文献【12】已经证明平均情况问题$SIS_{q,m,\beta}$的难度近似跟最近想问题相等，在最糟的情况，对于任何有边界的特征$m,\beta$和任何素数$q \geq /beta \cdot w(\sqrt{nlogn})$。</p>
<p>错误学习假设【18】$LWE_{q,m,\chi}$以一种适合我们应用的方式被描述。</p>
<p>一个正整数$n$，整数$m \geq n $，$q \geq 2$，一个向量$s \in Z_q^q$，在$Z_q^m$上一个概率分布$\chi$。选择一致矩阵$A \leftarrow Z_q^{n \times m}$，向量$e \leftarrow \chi$，和向量$y \leftarrow Z^m_q$。分布$(A,A^T,s+e)$和分布$(A,y)$是难以区分的。</p>
<p>文献【18】已经证明$LWE_{q,m,\chi}$的难度跟利用量子算法解决几个标准的最糟情况的格问题一样。</p>
<h2 id="三、提出的模型"><a href="#三、提出的模型" class="headerlink" title="三、提出的模型"></a>三、提出的模型</h2><h3 id="1、系统模型"><a href="#1、系统模型" class="headerlink" title="1、系统模型"></a>1、系统模型</h3><p>对于公开审计，一个代表性的系统模型见图1。公开审计的系统模型中有三个不同的实体。</p>
<p>用户：拥有大量数据文件需要存储到云上，依赖云来进行数据维护和计算，其可以是个人消费者也可以是组织。</p>
<p>云服务器提供商(CSP)：其是管理云服务器的实体，拥有大量的存储空间和计算资源来维护和计算用户的数据。</p>
<p>第三方审计者(TPA):其拥有用户没有的能力和专业知识，被信任来代表用户评估和揭露云存储服务的危险。</p>
<p><img src="https://i.imgur.com/QBgIohN.png" alt=""></p>
<p>在云系统中，通过将大数据文件上传至云服务器，用户可以释放存储和计算的负担。首先，用户计算数据的标签，并发送数据和标签给云服务器。在云 存储系统中，用户存储他们的数据到一系列云服务器中，它们以一种协作和分布式的方式工作。然后，用户不再本地地处理他们的数据。如果用户想去检验数据是否完整的存在的服务器中，执行审计工作，如图1。</p>
<ul>
<li><strong>初始化</strong> 用户与CSP和TPA协商加密密钥。</li>
<li><strong>挑战</strong> 收到来自用户的审计请求后，TPA生成并发送挑战给CSP。</li>
<li><strong>证据</strong> 一收到来自TPA的挑战，CSP生成存储数据的证据并发送它给TPA。</li>
<li><strong>验证</strong> 使用一些公开参数，TPA验证来自CSP证据的正确性，并返回TRUE/FALSE给用户。</li>
</ul>
<h3 id="2、攻击模型"><a href="#2、攻击模型" class="headerlink" title="2、攻击模型"></a>2、攻击模型</h3><p>在云存储系统中，TPA被认为是诚实的和好奇的。在审计过程中，它诚实的执行审计程序，但它对收到的数据好奇。CSP被认为是不诚实的。一些破坏系统的攻击存在：</p>
<ul>
<li><strong>好奇攻击</strong> TPA通过分析公开参数和来自CSP的证据尝试恢复用户的数据。</li>
<li><strong>丢失攻击</strong> CSP丢失用户的数据，希望通过TPA的审计。</li>
<li><strong>篡改攻击</strong> CSP可能篡改用户的数据为其他非法的数据，并尝试通过TPA的审计。</li>
</ul>
<h3 id="3、设计目标"><a href="#3、设计目标" class="headerlink" title="3、设计目标"></a>3、设计目标</h3><p>根据系统模型和攻击模型，公开审计方案的设计目标可以总结如下：</p>
<ul>
<li><strong>不可伪造性</strong> 攻击者无法伪造用户的标签</li>
<li><strong>公开验证</strong> 任何人都可以执行审计，不仅仅存在数据到云服务器的用户，有能力去验证存储数据的完整性。</li>
<li><strong>隐私保护</strong> 在审计过程中，没有数据块被审计者TPA恢复。</li>
</ul>
<h2 id="四、提出的方案"><a href="#四、提出的方案" class="headerlink" title="四、提出的方案"></a>四、提出的方案</h2><h3 id="1-同态标签方案"><a href="#1-同态标签方案" class="headerlink" title="1. 同态标签方案"></a>1. 同态标签方案</h3><p>同态对于云存储证明是一个非常有用的工具。现在描述文献【15】提出的同态标签$(KeyGen,Sign,Combine,Verify)$方案，其包括如下四个多项式时间算法。$H:\lbrace 0,1\rbrace^{\ast} \rightarrow Z^m_q$是一个坑碰撞的哈希函数。</p>
<ul>
<li><strong>密钥生成</strong> 输入一个安全参数$n$。对任何整数$q$，Alice运行定理一中的$TrapGen(q,n)$算法来生成$A \in Z_q^{n \times m}$和陷门基$T \in Z^{m \times m}$分别当作公钥和私钥。</li>
<li><p><strong>标签</strong> 对于给定消息$F=\lbrace u_1,\dots,u_l \rbrace \in Z^m_q$，Alice执行如下操作：</p>
<ul>
<li>定义消息$F$的表促成为$id \in \lbrace 0,1 \rbrace ^{\ast}$。</li>
<li>计算$n$个向量$\alpha_j = H(id||j) \in Z^m_q$，其中$j \leq n$。</li>
<li>计算内积$h_{ij} = &lt;u_i, \alpha_j&gt;$，并组成向量$\vec{h_i}=(h_{i1},\dots,h_{in})^T$。</li>
<li>对于每个$i \in \lbrace 1,\dots, l \rbrace$，Alice运行定理二中的$SamplePre(A,T,\sigma,\vec{h_i})$生成向量$\vec{h_i}$标签$\vec{e_i}$。</li>
</ul>
</li>
<li><p><strong>联合</strong> 给定公钥$A$，身份标识$id$和一系列$(c_i,e_i)$，输出向量：</p>
</li>
</ul>
<p>$e_C = \sum_{i=1}^l c_i e_i$</p>
<p>$u_C = \sum_{i=1}^l c_i u_i$</p>
<p>$e_c$是消息$u_c$的签名。</p>
<ul>
<li><p><strong>验证</strong> 一收到联合的消息$u_C$和联合的标签，Bob执行如下操作：</p>
<ul>
<li>计算$\alpha_j = H(id||j) \in Z^m_q$，其j \leq n$$。</li>
<li>计算联合消息$u_c = \sum_{i=1}^l c_i u_i$。</li>
<li>计算内积$h_{C_j} = &lt;u_C,\alpha_j&gt;$，并组成向量$h_C = (h_{C_1},\dots,h_{C_n})^T$。</li>
<li><p>当且仅当如下的条件满足，则接受联合标签$e_C$:</p>
<p>  $A_{e_C}=h_C(mod q)$<br>  $||e_C|| \leq l \sigma \sqrt{m}$ </p>
</li>
</ul>
</li>
</ul>
<h3 id="2-云存储公开审计方案"><a href="#2-云存储公开审计方案" class="headerlink" title="2. 云存储公开审计方案"></a>2. 云存储公开审计方案</h3><p>当同态标签被用来公开地检验云存储数据完整性时，一个事实必须被考虑。首先，验证没有标签的文件，并且不知道任何关于文件的任何信息。然后，同态标签方案指出批量验证，为了避免CSP存储联合信息，于是TPA必须根据由自己生成的挑战$chal$来验证。基于系统模型，云存储的公开审计方案如下：</p>
<ul>
<li><p><strong>初始化</strong> 云存储服务以一种协作和分布式的方式工作。为了存储用户的数据$F$到一系列云服务器上，$f$需要分成$l$个数据块$u_1,\dots,u_l,u_i \in Z^m_q$。</p>
<ul>
<li>运行密钥$KeyGen$算法来获得用户的公钥$pk=\lbrace A \rbrace$和私钥$sk = \lbrace T \rbrace$。</li>
<li>对于$l$个数据块$u_1,\dots,u_l$，用户运行$Sign$算法，并输出相应的标签$e_1,\dots,e_l$。</li>
<li>用户发送文件$F=\lbrace u_1,\dots, u_l \rbrace$和相应的标签$e_1,\dots,e_l$到CSP，并删除本地数据文件$F=\lbrace u_1,\dots, u_l \rbrace$。</li>
</ul>
</li>
<li><p><strong>挑战</strong></p>
</li>
</ul>

      
    </div>
    
    
    

    
      <div>
        <div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/images/wechat-qcode.jpg" alt="zxp wechat" style="width: 200px; max-width: 100%;"/>
    <div>欢迎关注微信公众号！</div>
</div>

      </div>
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div></div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/WeChatpay.jpg" alt="zxp 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/Alipay.jpg" alt="zxp 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者：</strong>
    zxp
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://zxpgo.github.io/2018/10/03/Public Proof of Cloud Storage from Lattice Assumption/" title="Public Proof of Cloud Storage from Lattice Assumption∗">https://zxpgo.github.io/2018/10/03/Public Proof of Cloud Storage from Lattice Assumption/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>
    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处！
  </li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tag/论文/" rel="tag"># 论文</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div id="needsharebutton-postbottom">
            <span class="btn">
              <i class="fa fa-share-alt" aria-hidden="true"></i>
            </span>
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/10/02/NP问题理解/" rel="next" title="NP问题理解">
                <i class="fa fa-chevron-left"></i> NP问题理解
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/10/04/C++ Primer Plus--函数(C++的变成模块)（七）/" rel="prev" title="C++ Primer Plus--函数(C++的编程模块)（七）">
                C++ Primer Plus--函数(C++的编程模块)（七） <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zODgxNC8xNTM0Mg=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/avatar.gif"
                alt="zxp" />
            
              <p class="site-author-name" itemprop="name">zxp</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">176</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">48</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_25774883" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-globe"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/zxpgo/zxpgo" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-globe"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.linkedin.com/feed/" target="_blank" title="LinkedIn">
                      
                        <i class="fa fa-fw fa-globe"></i>LinkedIn</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="1165772354@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-inline">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://theme-next.iissnan.com" title="Next主题" target="_blank">Next主题</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://blog.rexking6.top" title="青爷博客" target="_blank">青爷博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://me.csdn.net/download/qq_25774883" title="CSDN下载" target="_blank">CSDN下载</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.livere.com/" title="来必力" target="_blank">来必力</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://tongji.baidu.com/web/welcome/login" title="百度统计" target="_blank">百度统计</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://leancloud.cn/" title="LeanCloud" target="_blank">LeanCloud</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://ibruce.info/2015/04/04/busuanzi/" title="不蒜子" target="_blank">不蒜子</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://leetcode-cn.com/" title="LeetCode" target="_blank">LeetCode</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#摘要"><span class="nav-number">1.</span> <span class="nav-text">摘要</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#一、前言"><span class="nav-number">2.</span> <span class="nav-text">一、前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二、预备知识"><span class="nav-number">3.</span> <span class="nav-text">二、预备知识</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-格"><span class="nav-number">3.1.</span> <span class="nav-text">1.格</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-离散高斯抽样"><span class="nav-number">3.2.</span> <span class="nav-text">2. 离散高斯抽样</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-困难假设"><span class="nav-number">3.3.</span> <span class="nav-text">3. 困难假设</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三、提出的模型"><span class="nav-number">4.</span> <span class="nav-text">三、提出的模型</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1、系统模型"><span class="nav-number">4.1.</span> <span class="nav-text">1、系统模型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2、攻击模型"><span class="nav-number">4.2.</span> <span class="nav-text">2、攻击模型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3、设计目标"><span class="nav-number">4.3.</span> <span class="nav-text">3、设计目标</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#四、提出的方案"><span class="nav-number">5.</span> <span class="nav-text">四、提出的方案</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-同态标签方案"><span class="nav-number">5.1.</span> <span class="nav-text">1. 同态标签方案</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-云存储公开审计方案"><span class="nav-number">5.2.</span> <span class="nav-text">2. 云存储公开审计方案</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div>
<script async src="https//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_pv" style='display:none'>
    本站总访问量 <span id="busuanzi_value_site_pv"></span> 
    <span class="post-meta-divider">|</span>
</span>
<span id="busuanzi_container_site_uv" style='display:none'>
    访问人数 <span id="busuanzi_value_site_uv"></span>
</span>
</div>


<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; 2018-8 &mdash; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-"></i> Power by 
  </span>
  <span class="author" itemprop="copyrightHolder">zxp</span>
  
  
</div>









        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    
      <div id="needsharebutton-float">
        <span class="btn">
          <i class="fa fa-share-alt" aria-hidden="true"></i>
        </span>
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  




  
  <div id="lv-container" data-uid="MTAyMC8zODgxNC8xNTM0Mg==">
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
	</div>
  











  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("2AyV3DKioBSdoryrFLRohzjB-gzGzoHsz", "XynedcHyJCVCrTfbD4yYnodo");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">

  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>

  <script>
    
      pbOptions = {};
      
          pbOptions.iconStyle = "default";
      
          pbOptions.boxForm = "vertical";
      
          pbOptions.position = "top";
      
          pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
      flOptions = {};
      
          flOptions.iconStyle = "box";
      
          flOptions.boxForm = "horizontal";
      
          flOptions.position = "middleRight";
      
          flOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-float', flOptions);
    
  </script>

  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  
  <script type="text/javascript" src="/js/src/js.cookie.js?v=5.1.4"></script>
  <script type="text/javascript" src="/js/src/scroll-cookie.js?v=5.1.4"></script>


  
  <script type="text/javascript" src="/js/src/exturl.js?v=5.1.4"></script>


  
  
  	 <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("2AyV3DKioBSdoryrFLRohzjB-gzGzoHsz", "XynedcHyJCVCrTfbD4yYnodo");</script>
<script>
function showTime(Counter) {
	var query = new AV.Query(Counter);
	$(".leancloud_visitors").each(function() {
		var url = $(this).attr("id").trim();
		query.equalTo("url", url);
		query.find({
			success: function(results) {
				if (results.length == 0) {
					var content = $(document.getElementById(url)).text() + ' 0';
					$(document.getElementById(url)).text(content);
					return;
				}
				for (var i = 0; i < results.length; i++) {
					var object = results[i];
					var content = $(document.getElementById(url)).text() + ' ' + object.get('time');
					$(document.getElementById(url)).text(content);
				}
			}
		});

	});
}

</script>
  
</body>
</html>
